package com.itheima.stock.controller;

import com.itheima.stock.service.StockService;
import com.itheima.stock.service.UserService;
import com.itheima.stock.vo.req.LoginReqVo;
import com.itheima.stock.vo.resp.LoginRespVo;
import com.itheima.stock.vo.resp.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/api")
@CrossOrigin
public class UserController {
    @Autowired
    private StockService stockService;
    @Autowired
   private UserService userService;
     @PostMapping("/login")
    public R<LoginRespVo> tast(@RequestBody LoginReqVo vo){
        R<LoginRespVo> r= userService.login(vo);
        return r;
    }
    @GetMapping("/captcha")
    public R<Map> genrateCaptcha(){
         return this.userService.generateCaptcha();
    }



}
